package com.zuoye.day13;

import java.util.Objects;

public class Product4 {
    private String brand;
    private String name;
    private double cost;

    public Product4(){}
    public Product4(String brand, String name, double cost) {
        this.brand = brand;
        this.name = name;
        this.cost = cost;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getCost() {
        return cost;
    }

    public void setCost(double cost) {
        this.cost = cost;
    }

    @Override
    public String toString() {
        return "Product4{" +
                "brand='" + brand + '\'' +
                ", name='" + name + '\'' +
                ", cost=" + cost +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Product4 product4 = (Product4) o;
        return Objects.equals(brand, product4.brand);
    }

    @Override
    public int hashCode() {
        return Objects.hash(brand);
    }
}
